/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * TrainingBook
 * Copyright (C) Arnaud Duval 2010 <arnaud.duval@gmail.com>
 * 
 * TrainingBook is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * TrainingBook is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _R_G_B_COLOR_HPP_
#define _R_G_B_COLOR_HPP_

#include <iostream>


///@brief Definition of predefined color code
#define RED_COLOR 1
#define GREEN_COLOR 2
#define BLUE_COLOR 3
#define WHITE_COLOR 4
#define BLACK_COLOR 5
#define PURPLE_COLOR 6
#define YELLOW_COLOR 7
#define BROWN_COLOR 8
#define ORANGE_COLOR 9


///@class RGBcolor
///@brief Defines a color with red green blue definition
class RGBcolor
{
    public:
        ///@brief Constructor
        RGBcolor();
        ///@brief Constructor with arguments
        RGBcolor(double, double, double);
        ///@brief Copy conctructor
        RGBcolor(const RGBcolor&);
        ///@brief Destructor
        ~RGBcolor();
        ///@brief Overload of = operator
        RGBcolor& operator=(const RGBcolor &);
        ///@brief Return red value
        double Red();
        ///@brief Return green value
        double Green();
        ///@brief Return blue value
        double Blue();
        ///@brief Set red value
        void SetRed(double);
        ///@brief Set green value
        void SetGreen(double);
        ///@brief Set blue value
        void SetBlue(double);
        ///@brief Set the color with predefined value
        void SetPredefined(unsigned int);


		///@brief Overload of << operator
		friend std::ostream& operator << (std::ostream &, const RGBcolor&);
		///@brief Overload of == operator : comparison of 2 RGBcolor objects
		friend bool operator==(const RGBcolor&, const RGBcolor&);
		///@brief Overload of != operator : comparison of 2 RGBcolor objects
		friend bool operator!=(const RGBcolor&, const RGBcolor&);
		///@brief Overload of + operator
		friend RGBcolor operator+ (const RGBcolor&, const RGBcolor&);
		///@brief Overload of - operator
		friend RGBcolor operator- (const RGBcolor&, const RGBcolor&);

		
	protected:

	private:
		///@brief red value between 0 and 1
		double red;
		///@brief green value between 0 and 1
		double green;
		///@brief blue value between 0 and 1
		double blue;
};

#endif // _R_G_B_COLOR_HPP_
